<html>

<head>
    <link rel="icon" href="/front/image/bitbug_favicon.ico" type="image/x-icon">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=8">
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-control" content="no-cache">
    <meta http-equiv="Cache" content="no-cache">
    <meta name="format-detection" content="telephone=no">
    <title>{$region['title']}</title>
    <link rel="stylesheet" type="text/css" href="{MODULE_URL}template/mobile/style/style1/static/css/style.css" />
    <link rel="stylesheet" type="text/css" href="{MODULE_URL}template/mobile/style/style1/static/css/region.css" />
    <link href="{$_W['siteroot']}app/resource/css/font-awesome.min.css" rel="stylesheet">
    <!--组件依赖js begin-->
    <script type="text/javascript" src="{MODULE_URL}template/mobile/style/style1/static/js/zepto.js"></script>
    <script type="text/javascript" src="{MODULE_URL}template/mobile/style/style1/static/js/zepto.extend.js"></script>
    <script type="text/javascript" src="{MODULE_URL}template/mobile/style/style1/static/js/zepto.ui.js"></script>
    <script type="text/javascript" src="{MODULE_URL}template/mobile/style/style1/static/js/zepto.fix.js"></script>
    <!--刷新-->
    <script type="text/javascript" src="{MODULE_URL}template/mobile/style/style1/static/js/refresh.js"></script>

    <style type="text/css">
    /*加载*/
    
    .ui-refresh-down {
        height: 42px;
        border-top: 1px solid #e4e4e4;
        border-bottom: 1px solid #e4e4e4;
        line-height: 42px;
        background: #f0f0f0;
        text-align: center;
    }
    
    .ui-refresh-icon {
        display: inline-block;
        content: '';
        background:url({MODULE_URL}template/mobile/style/style1/static/image/arrow-down.png) no-repeat;
        width: 12px;
        background-size: 12px;
        height: 7px;
        margin-right: 5px;
    }
    
    .ui-refresh-icon {
        display: inline-block;
        content: '';
        background:url({MODULE_URL}template/mobile/style/style1/static/image/arrow-down.png) no-repeat;
        width: 12px;
        background-size: 12px;
        height: 7px;
        margin-right: 5px;
    }
    
    .ui-loading {
        display: inline-block;
        content: '';
        background:url({MODULE_URL}template/mobile/style/style1/static/image/loading.gif) no-repeat;
        width: 16px;
        background-size: 16px;
        height: 16px;
        margin-right: 5px;
    }
    .right_img {
        background:url({MODULE_URL}template/mobile/style/style1/static/image/right_h.png) center center no-repeat; 
        background-size: 40px;
        width: 50px;
        height: 42px;
        position: absolute;
        z-index: 2;
        top: 0;
        right: 0;
    }
    .market_search {
        width: 80%;
        height: 32px;
        clear: both;
        float: left;
        /* margin: 0 auto; */
        position: relative;
        top: 30px;
        left: 30px;
        bottom: 10px;
        border: 1px solid #c6c6c6;
        border-radius: 3px;
        box-sizing: border-box;
    }
    .searchTxt {
        width: 80%;
        height: 30px;
        border: 0;
        float: left;
        outline: none;
        padding-left: 10px;
    }
    .market_search button {
        position: absolute;
        width: 40px;
        height: 18px;
        right: 0;
        top: 5px;
        color: #ccc;
        background: none;
        border: none;
        line-height: 20px;
        outline: none;
        font-size: 20px
    }
    </style>
    <script type="text/javascript">
    var path = "{php echo $this->createMobileUrl('shopping',array('op' => 'category'))}";
    var user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2552.0 Safari/537.36';
    </script>
</head>

<body class="bg-f2">
    <script src="{MODULE_URL}template/mobile/style/style1/static/js/good_category.js"></script>
    <section class="catego_main" style="display: none;">
        <div class="index-top" style="z-index:1000;">
            <!-- 20150504-头部-start -->
            <!-- <header class="header" id="index-header" style="background-color: #F6F6F6;">
                <section class="header-return1" onclick="platformCategory.closeCates();"></section>
                <section class="header-title">商品分类</section>
            </header> -->
            <header id="header">
            <div class="header_div">
                <div id="left_div" onclick="platformCategory.closeCates();"></div>
                <div id="middle_div" style="padding-top:6px;">
                    <h1 id="title"  style="line-height:30px;">商品分类</h1>
                </div>
                <div id="right_div">
                    <div class="right_bottom"></div>
                    <!-- <div class="right_img"></div> -->
                </div>
            </div>
        </header>
            <!-- 20150504-头部-start -->
        </div>
        <!--选项卡 start-->
        <article class="main-box">
            <div class="class_list_nav">
                <ul id="rootCategories">
                    <li></li>
                </ul>
            </div>
            <div class="class-box" style="margin-top:-20px">
                <!--1 start-->
                <div class="class-box-sub" id="childCategories">
                    <ul class="clearfix">
                        
                    </ul>

                </div>
                <!--2 end-->
            </div>
        </article>
        <!--选项卡 end-->
    </section>
    

    <div class="index-top" id="index-top">
        <!-- 20150504-头部-start -->
        <!-- <header class="header" id="index-header">
            <a id="index-home" class="index-home" style="left:0;" href="/front/index.do"></a>
            <form id="subForm" onsubmit="$('#encodeGoodsName').val(encodeURI($('[name=goodName]').val()));" action="/front/goods/list.do">
                <section class="index-input">
                    <input class="select-input" id="goodsName" name="goodName" type="text" value="" placeholder="搜索内容">
                    <input class="select-input" id="encodeGoodsName" name="encodeGoodsName" type="hidden">
                    <a onclick="$('#subForm').submit()" class="index-select"></a>
                </section>
            </form>
            <section class="index-classify" onclick="javascript:platformCategory.openCates();"></section>
        </header> -->
        <header id="header">
            <div class="header_div">
                <div id="left_div" onClick="javascript:history.back();"></div>
                <div id="middle_div" style="padding-top:6px;">
                    <h1 id="title"  style="line-height:30px;">全部商品</h1>
                </div>
                <div id="right_div">
                    <div class="right_bottom"></div>
                    <div class="right_img" onclick="javascript:platformCategory.openCates();"></div>
                </div>
            </div>
        </header>
        <p class="market_search" style="margin-top:20px;">
                <input type="text" class="searchTxt" id="search_keywords" name='keyword' placeholder="商品搜索：请输入商品关键字">
                <button type="button" class="search_btn"><i class="fa fa-search"></i></button>
        </p>
        <!-- 20150504-头部-start -->
    </div>
<!--     <div class="search-tab">
        <ul id="selectBtn">
            <li id="inputTime" class="on">默认</li>
            <li id="salesNum">销量</li>
            <li id="hotNum">人气</li>
            <li class="sort-by-price" id="discountPrice">价格</li>
        </ul>
    </div> -->
    <div class="hr-144" id="goto_top"></div>
    <!-- 20150504-产品列表-end -->
    <a href="javascript:window.location.href='{php echo $this->createMobileUrl('shopping',array('op' => 'mycart'))}';" class="footer-car" id="counts"><span>{$carttotal}</span></a>
    <div id="goodsContainerDiv" class="channel-floor ui-refresh" style="margin-top:10px">
        <!---产品列表-start -->
        <ul class="channel-floor-ul floor-two-ul">

  
        </ul>
         <div class="ui-refresh-down" style="clear:both"></div>
    </div>
    <div class="hr-150-1"></div>
    <!--底部-->
    <script>
    $(document).ready(function() {

        $('.search_btn').click(function() {
            window.location.href = "{php echo $this->createMobileUrl('shopping',array('op' => 'list'))}" +"&keywords=" + $("#search_keywords").val();
        });
           
    });
    /*ajax请求函数,判断共几页，呈现不同效果*/
    (function() {
        xqAjax();

        function xqAjax() {
            var url = "{php echo $this->createMobileUrl('shopping',array('op' => 'list'))}";
            var pcate = "{$_GPC['pcate']}";
            var keywords = "{$_GPC['keywords']}";
            $.ajax({
                url: url,
                async: false,
                type: 'post',
                dataType: 'json',
                data: {
                    pcate:pcate,
                    keywords:keywords
                },
                beforeSend: function() {
                 
                },
                success: function(data) {

                    var $list = $('.floor-two-ul'),
                        html = (function(data) { //数据渲染
                            var liArr = [];
                            $.each(data.allhtml, function() {
                                liArr.push(this.html);
                            });
                            return liArr.join('');
                        })(data);

                    $('.floor-two-ul').html(html)
                    if (data.page_count < 2) {
                        $(".ui-refresh-down").html("<span class='ui-refresh-label'>没有更多内容了</span>");
                    } else {
                        refreshFun();
                    }

                },
                // error: function() {
                //     alert('请求不到数据，请重新搜索！');
                // }

            })
        }

        /*组件初始化refreshFun函数*/

        function refreshFun() {
            var index = 1;
            $('.ui-refresh').refresh({
                ready: function(dir, type) {
                    var me = this;
                    var pcate = "{$_GPC['pcate']}";
                    index++;
                    $.getJSON("{php echo $this->createMobileUrl('shopping',array('op' => 'list'))}", {
                        page: index,
                        pcate:pcate
                    }, function(data) {
                        var $list = $('.floor-two-ul'),
                            html = (function(data) { //数据渲染
                                var liArr = [];
                                $.each(data.allhtml, function() {
                                    liArr.push(this.html);
                                });
                                return liArr.join('');
                            })(data);

                        $list[dir == 'up' ? 'prepend' : 'append'](html);
                        if (index < data.page_count) {
                            me.afterDataLoading();
                        } else {
                            me.disable(dir, false);
                        }
                    });
                }
            });

        }
        /*组件初始化js end*/
    })();

    $(function() {
        select('a1');
    });
    </script>
{template 'style/style1/footer'}
</body>

</html>
